package com.bdth.bdthmall.api.epoint.controller;

import com.alibaba.fastjson.JSONObject;
import com.bdth.bdthmall.api.annotation.AuthToken;
import com.bdth.bdthmall.api.epoint.vo.ResponseProductImageVo;
import com.bdth.bdthmall.api.epoint.vo.ResponseProductInventoryVo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2020/1/14.
 * 库存模块
 */
@RestController
@RequestMapping("/ecservice")
public class InventoryController {
    @RequestMapping(value = "/getProductInventory", method = RequestMethod.POST)
    @AuthToken
    public ResponseProductInventoryVo getProductInventory(@RequestParam String data) {
        JSONObject json = JSONObject.parseObject(data);
        String sku = json.getString("sku");
        int num = json.getInteger("num");
        String cityId = json.getString("cityId");
        String countyId = json.getString("countyId");
        System.out.println("num:"+num);
        System.out.println("cityId:"+cityId);
        System.out.println("countyId:"+countyId);
        ResponseProductInventoryVo productInventoryVo = new ResponseProductInventoryVo();
        productInventoryVo.setIsSuccess(true);
        productInventoryVo.setReturnMsg("商品库存查询");
        productInventoryVo.setSkuId(sku);
        productInventoryVo.setState("00");
        return productInventoryVo;
    }
    /**
     * {"accessToken":"ff587d8b-b9fe-4d21-a8d6-8f519d407cab","appKey":"epoint","sku":"120855119","num":1,"cityId":"025","countyId":"01"}
     */
}
